package org.bhf.service;

/**
 * Copyright (c) 2007, Blue Hole Software. All rights reserved.
 * Code licensed under the Apache 2.0 License:
 * http://www.apache.org/licenses/
 */

/**
 * All <code>Component</code>s must implement this interface.
 * @see org.bhf.service.AbstractComponent
 */
public interface Component
{
    /**
     * Return the current state version of this <code>Component</code>. Each state change, whether client or
     * server side, must increment the version of the state.
     * @return The current state version of this <code>Component</code>.
     */
    int     getVersion();

    /**
     * Do not call. Should only be called by <code>ComponentProcessView</code>
     * @exclude
     */
    void    setVersion();

    /**
     * Do not call. Should only be used when unmarshalling a <code>Component</code>
     * @param version <code>Component</code> version.
     * @exclude
     */
    void    setVersion( int version );

    /**
     * Return the unique ID for this <code>Component</code>. IDs are unique wrt to the service class.
     * @return The unique ID for this <code>Component</code>.
     */
    long    getId();

    /**
     * Do not call. Should only be used when unmarshalling a <code>Component</code>
     * @param uuid <code>Component</code> ID.
     * @exclude
     */
    void    setId( long uuid );

    /**
     * Returns <code>true</code> if this <code>Component</code> was changed during a method invocation.
     * @return <code>true</code> if this <code>Component</code> was changed during a method invocation.
     */
    boolean isChanged();
}
